using System;
using Widgetsphere.Core.DataAccess;

namespace ACME.Northwind.Business.Objects
{
	#region CustomerCustomerDemoPrimaryKey

	/// <summary>
	/// A strongly-typed primary key object for the 'CustomerCustomerDemo' table.
	/// </summary>
	[Serializable()]
	public class CustomerCustomerDemoPrimaryKey : IPrimaryKey
	{
		private string mCustomerId;
		private string mCustomerTypeId;

		/// <summary>
		/// The constructor for this object which takes the fields that compreise the primary key for the 'CustomerCustomerDemo' table.
		/// </summary>
		public CustomerCustomerDemoPrimaryKey(string customerid, string customertypeid)
		{
			mCustomerId = customerid;
			mCustomerTypeId = customertypeid;
		}

		/// <summary>
		/// A primary key for the 'CustomerCustomerDemo' table.
		/// </summary>
		public string CustomerId
		{
			get { return mCustomerId; }
		}

		/// <summary>
		/// A primary key for the 'CustomerCustomerDemo' table.
		/// </summary>
		public string CustomerTypeId
		{
			get { return mCustomerTypeId; }
		}

		/// <summary>
		/// Returns a value indicating whether the current object is equal to a specified object.
		/// </summary>
		public override bool Equals(object obj)
		{
			if (obj == null) return false;
			if (obj.GetType() == this.GetType())
			{
			bool retval = true;
			retval &= (this.CustomerId == ((CustomerCustomerDemoPrimaryKey)obj).CustomerId);
			retval &= (this.CustomerTypeId == ((CustomerCustomerDemoPrimaryKey)obj).CustomerTypeId);
				return retval;
			}
			return false;
		}

		/// <summary>
		/// Serves as a hash function for this particular type.
		/// </summary>
		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

	}

	#endregion

}
